<template>
  <!-- 模板内容：只能有一个div  -->
  <div>
    <div class="content">
      <div class="content_awipper">
        <van-swipe class="my-swipe" :autoplay="3000" indicator-color="#1989fa">
          <van-swipe-item v-for="(item, index) in list" :key="index">
            <a href="">
              <ul>
                <li class="list_img">
                  <img :src="item.img" alt="" />
                  <a href="">{{ item.title }}</a>
                  <div>
                    <span>{{ item.explain1 }}</span
                    >&nbsp;&nbsp;&nbsp;&nbsp;<span>{{ item.explain2 }}</span>
                  </div>
                </li>
              </ul>
            </a></van-swipe-item
          >
        </van-swipe>
      </div>
    </div>
  </div>
</template>
<script>
import axios from "axios";
export default {
  name: "ContentSwiper",
  data() {
    return {
      list: [],
    };
  },
  created() {
    this.fn_one();
  },
  methods: {
    async fn_one() {
      let { data } = await axios.get(
        "https://mock.presstime.cn/mock/61bbe55090bfb20016179195/broducttest/shoppingcard"
      );
      this.list = data.content_content_img;
      console.log(data.content_content_img);
    },
  },
};
</script>

<style lang="less" scoped>
/* css样式 */
.content {
  width: 490px;
  height: 300px;
    
}
.list_img {
  position: relative;
  a {
    position: absolute;
    left: 20px;
    bottom: 50px;
    font-size: 26px;
    font-weight: bold;
    color: cornsilk;
  }
  div {
    position: absolute;
    left: 20px;
    bottom: 28px;
    color: cornsilk;
  }
}
/deep/.my-swipe{
    height: 270px;
}
/deep/ .van-swipe__indicators{
    bottom: 0px;
    z-index: 999;
  
}
/deep/ .van-swipe__indicator{
        background-color: #000;
  }
</style>